using System.Collections;
using System.Collections.Generic;
using Game.Framework.FState;
using Game.Framework.UI;
using UnityEngine;

namespace Game.Applcation
{
    public class UILaunchingStateProgress : UIStateBase
    {
        private UILaunching _view;
        private float _maxTime = 1f;

        public override void Enter(StateData param)
        {
            base.Enter(param);

            _view = _data.view as UILaunching;
        }

        public override void FixedUpdate(float deltaTime)
        {
            base.FixedUpdate(deltaTime);

            if (_elapsedTime >= _maxTime)
            {
                ChangeState<UIStateNormal>(new UIStateData(_view));
                return;
            }

            var progress = _elapsedTime / _maxTime;
            _view.SetProgress(progress);
        }
    }
}


